﻿@model BrnMall.Web.StoreAdmin.Models.AddStaffTemplateModel

@section header{
    <title>添加配送模板-配送模板</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.unobtrusive.js"></script>
<script type="text/javascript" src="~/admin_store/scripts/staff/departmentlist.js"></script>
}

@section body{
    <h1 class="rightH1">
		微信小程序 &gt; 店铺管理 &gt; 配送模板 &gt; <span class="rightH1-cur">添加配送模板</span> 
        <div class="right">
            <a href="@Html.Raw(ViewData["referer"].ToString())" class="menuBT"><img src="/admin_store/images/goback.jpg" />返回列表</a>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </h1>

    @using (Html.BeginForm())
    {
        <div class="addTable">
            <table width="100%">
                <tr>
                    <td width="80px" align="right">姓名：</td>
                    <td>@Html.TextBoxFor(x => x.Name, new { @class = "input", size = "35" })@Html.ValidationMessageFor(x => x.Name)</td>
                </tr>
                <tr>
                    <td width="80px" align="right">职位：</td>
                    <td>@Html.TextBoxFor(x => x.Position, new { @class = "input", size = "35" })@Html.ValidationMessageFor(x => x.Position)</td>
                </tr>
                <tr>
                    <td width="80px" align="right">绑定微信手机号：</td>
                    <td>@Html.TextBoxFor(x => x.Phone, new { @class = "input", size = "35" })@Html.ValidationMessageFor(x => x.Phone)</td>
                </tr>
                <tr>
                    <td width="80px" align="right">名片展示手机号：</td>
                    <td>@Html.TextBoxFor(x => x.Mobile, new { @class = "input", size = "35" })@Html.ValidationMessageFor(x => x.Mobile)</td>
                </tr>
                <tr>
                    <td width="80px" align="right">
                    @Html.HiddenFor(x=>x.DepartmentId)
                    部门：</td>
                    <td class="depLists">
                    </td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td>
                        <a href="" class="addBt" id="sumbitBut"><img src="/admin_store/images/submit.jpg" /></a>
                        <script type="text/javascript">
                            $(function () {
                                $("#freeorderamount").css("display", "none");
                                $(".freetype").click(function () {
                                    console.log($(this).val())
                                    if ($(this).val() === "2")
                                        $("#freeorderamount").css("display","");
                                    else
                                        $("#freeorderamount").css("display", "none");
                                })


                                $("#sumbitBut").click(function () {
                                    var arr = [];
                                    $.each($('input:checkbox:checked'), function () {
                                        arr.push($(this).val())
                                    });
                                    if (arr.length <= 0) return;
                                    $('#DepartmentId').val(arr.join(','));
                                    $("form:first").submit();
                                    return false;
                                })
                            });
                        </script>
                    </td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </div>
    }
}